<%@ page session="false" language="java" contentType="text/html; charset=UTF-8" trimDirectiveWhitespaces="true"
         pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/views/include.inc.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>管线业务</title>
    <link rel="stylesheet" href="${contextPath}/resources/assets/css/bootstrap.css"/>
    <link rel="stylesheet" href="${contextPath}/resources/assets/css/font-awesome.css"/>
    <link rel="stylesheet" href="${contextPath}/resources/assets/css/ace-fonts.css"/>
    <link rel="stylesheet" href="${contextPath}/resources/assets/css/ace.css" class="ace-main-stylesheet"
          id="main-ace-style"/>
    <link rel="stylesheet" type="text/css" href="${contextPath}/resources/css/fayz.css"/>
    <script src="${contextPath}/resources/assets/js/ace-extra.js"></script>
    <script type="text/javascript">
        window.jQuery || document.write("<script src='${contextPath}/resources/assets/js/jquery.js'>" + "<" + "/script>");
    </script>
    <script src="${contextPath}/resources/js/fayz.js" type="text/javascript"></script>

    <script type="text/javascript">
        var contextPath = '${contextPath}';
        var compId = '${compId}';
        var sIntroduction = '${sIntroduction}';
        var sPile = '${sPile}';
        var sHole = '${sHole}';
        var eIntroduction = '${eIntroduction}';
        var ePile = '${ePile}';
        var eHole = '${eHole}';
        var role = '${role}';
        var flag = '${flag}';

        $(function () {
            document.getElementById("yrd").innerHTML = "引入段：" + sIntroduction + "  桩号：" + sPile + "  孔位：" + sHole;
            document.getElementById("ycd").innerHTML = "引入段：" + eIntroduction + "  桩号：" + ePile + "  孔位：" + eHole;
            document.getElementById("compId").value = compId;
        });
    </script>
    <style>
        #webglcanvas {
            top: 0;
            left: 0;
            width: 600px;
            height: 400px;
            z-index: 2;
        }
    </style>
</head>
<body class="no-skin">
<jsp:include page="index.jsp" flush="true"/>

<div class="main-container" id="main-container">
    <div id="sidebar" class="sidebar                  responsive">
        <script type="text/javascript">
            try {
                ace.settings.check('sidebar', 'fixed');
            } catch (e) {
            }
        </script>

        <ul class="nav nav-list">
            <li class="">
                <a href="#" class="dropdown-toggle">
                    <i class="menu-icon fa fa-tag"></i>
                    <span class="menu-text"> 入廊申请 </span>

                    <b class="arrow fa fa-angle-down"></b>
                </a>

                <b class="arrow"></b>

                <ul class="submenu">
                    <li class="">
                        <a href="sqbDownUp?compId=&compName=&phoneNo=">
                            <i class="menu-icon fa fa-caret-right"></i> 申请表格下载/上传
                        </a>

                        <b class="arrow"></b>
                    </li>

                    <li class="">
                        <a href="sqbRecord">
                            <i class="menu-icon fa fa-caret-right"></i> 申请记录
                        </a>

                        <b class="arrow"></b>
                    </li>
                </ul>
            </li>

            <li class="active open">
                <a href="#" class="dropdown-toggle">
                    <i class="menu-icon fa fa-tag"></i>
                    <span class="menu-text"> 手续办理 </span>

                    <b class="arrow fa fa-angle-down"></b>
                </a>

                <b class="arrow"></b>

                <ul class="submenu">
                    <li class="active">
                        <a href="ywcz?compId=&compName=">
                            <i class="menu-icon fa fa-caret-right"></i> 业务操作
                        </a>

                        <b class="arrow"></b>
                    </li>

                    <li class="">
                        <a href="ywda">
                            <i class="menu-icon fa fa-caret-right"></i> 业务档案
                        </a>

                        <b class="arrow"></b>
                    </li>
                </ul>
            </li>

            <li class="">
                <a href="#" class="dropdown-toggle">
                    <i class="menu-icon fa fa-tag"></i>
                    <span class="menu-text"> 合同管理 </span>

                    <b class="arrow fa fa-angle-down"></b>
                </a>

                <b class="arrow"></b>

                <ul class="submenu">
                    <li class="">
                        <a href="htmbDownUp">
                            <i class="menu-icon fa fa-caret-right"></i> 合同模板下载/上传
                        </a>

                        <b class="arrow"></b>
                    </li>

                    <li class="">
                        <a href="htda">
                            <i class="menu-icon fa fa-caret-right"></i> 合同档案
                        </a>

                        <b class="arrow"></b>
                    </li>
                </ul>
            </li>

            <li class="">
                <a href="#" class="dropdown-toggle">
                    <i class="menu-icon fa fa-tag"></i>
                    <span class="menu-text"> 施工管理 </span>

                    <b class="arrow fa fa-angle-down"></b>
                </a>

                <b class="arrow"></b>

                <ul class="submenu">
                    <li class="">
                        <a href="xkgl">
                            <i class="menu-icon fa fa-caret-right"></i> 许可管理
                        </a>

                        <b class="arrow"></b>
                    </li>

                    <li class="">
                        <a href="bzjgl">
                            <i class="menu-icon fa fa-caret-right"></i> 保证金管理
                        </a>

                        <b class="arrow"></b>
                    </li>

                    <li class="">
                        <a href="fwsq">
                            <i class="menu-icon fa fa-caret-right"></i> 服务申请
                        </a>

                        <b class="arrow"></b>
                    </li>

                    <li class="">
                        <a href="sgrz">
                            <i class="menu-icon fa fa-caret-right"></i> 施工日志
                        </a>

                        <b class="arrow"></b>
                    </li>
                </ul>
            </li>

            <li class="">
                <a href="#" class="dropdown-toggle">
                    <i class="menu-icon fa fa-tag"></i>
                    <span class="menu-text"> 费用清算 </span>

                    <b class="arrow fa fa-angle-down"></b>
                </a>

                <b class="arrow"></b>

                <ul class="submenu">
                    <li class="">
                        <a href="feeSimulate">
                            <i class="menu-icon fa fa-caret-right"></i> 入廊费用计算器
                        </a>

                        <b class="arrow"></b>
                    </li>

                    <li class="">
                        <a href="jfRecord">
                            <i class="menu-icon fa fa-caret-right"></i> 缴费记录
                        </a>

                        <b class="arrow"></b>
                    </li>
                </ul>
            </li>

            <li class="">
                <a href="#" class="dropdown-toggle">
                    <i class="menu-icon fa fa-tag"></i>
                    <span class="menu-text"> 后台管理 </span>

                    <b class="arrow fa fa-angle-down"></b>
                </a>

                <b class="arrow"></b>

                <ul class="submenu">
                    <li class="">
                        <a href="#">
                            <i class="menu-icon fa fa-caret-right"></i> 入廊申请
                        </a>

                        <b class="arrow"></b>
                    </li>

                    <li class="">
                        <a href="#">
                            <i class="menu-icon fa fa-caret-right"></i> 业务档案
                        </a>

                        <b class="arrow"></b>
                    </li>

                    <li class="">
                        <a href="#">
                            <i class="menu-icon fa fa-caret-right"></i> 合同档案
                        </a>

                        <b class="arrow"></b>
                    </li>

                    <li class="">
                        <a href="#">
                            <i class="menu-icon fa fa-caret-right"></i> 施工记录
                        </a>

                        <b class="arrow"></b>
                    </li>

                    <li class="">
                        <a href="#">
                            <i class="menu-icon fa fa-caret-right"></i> 缴费记录
                        </a>

                        <b class="arrow"></b>
                    </li>

                    <li class="">
                        <a href="gxdaEdit">
                            <i class="menu-icon fa fa-caret-right"></i> 管线档案
                        </a>

                        <b class="arrow"></b>
                    </li>
                </ul>
            </li>
        </ul>
        <div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
            <i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left"
               data-icon2="ace-icon fa fa-angle-double-right"></i>
        </div>

        <!-- /section:basics/sidebar.layout.minimize -->
        <script type="text/javascript">
            try {
                ace.settings.check('sidebar', 'collapsed');
            } catch (e) {
            }
        </script>
    </div>
    <div class="main-content">
        <div class="widget-box">
            <div class="widget-header widget-header-blue widget-header-flat">
                <h4 class="widget-title lighter"></h4>
            </div>

            <div class="widget-body">
                <div class="widget-main">

                    <div class="row">
                        <div class="col-xs-12">
                            <!--/section:plugins/printThis starts here  -->
                            <div id="print2">
                                <h3 class="lighter block green center" style="font: 24px/1.5 'Microsoft YaHei';">
                                    综合管廊入廊管线施工方案验证</h3>
                                <div class="col-sm-6 col-xs-12">
                                    <table class="girdtable col-xs-12" border="1"
                                           style="word-break:break-all; width:100%;">

                                        <tr>
                                            <td style="width:6%;text-align: center;">总平面
                                                <button type="button" style="float: right;margin-bottom: 2px;margin-right: 5px;" class="btn btn-primary" data-toggle="modal" data-target="#myModal1">上传</button>
                                            </td>
                                            <td class="center">
                                                <a href="javascript:;" onclick="fayzdownload('${sfileFiled1}')">${sfileFiled1}</a>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width:6%">管线布置</td>

                                            <td style="text-align: center;">
                                                <!-- webgl模型 -->
                                                <div id="webglcanvas"></div>
                                            </td>
                                        </tr>


                                    </table>
                                </div>
                                <div class="col-sm-6 col-xs-12">
                                    <table class="gridtable"
                                           style="word-break:break-all; width:100%;" border="1">
                                        <tr>
                                            <td style="width:10%">引入端
                                                <button type="button" style="float: right;margin-bottom: 2px;margin-right: 5px;" class="btn btn-primary" data-toggle="modal" data-target="#myModal2">上传</button>
                                            </td>
                                            <td rowspan="2" class="center"><img
                                                    src="${contextPath}/resources/UploadFiles/fayzImages/${sfileFiled2}"
                                                    style="max-width:100%;height:150px;"></td>
                                        </tr>
                                        <tr>
                                            <td style="width:10%;" id="yrd"></td>
                                        </tr>
                                        <tr>
                                            <td style="width:10%">引出端
                                                <button type="button" style="float: right;margin-bottom: 2px;margin-right: 5px;" class="btn btn-primary" data-toggle="modal" data-target="#myModal3">上传</button>
                                            </td>
                                            <td rowspan="2" class="center"><img
                                                    src="${contextPath}/resources/UploadFiles/fayzImages/${sfileFiled3}"
                                                    style="max-width:100%;height:150px;"></td>
                                        </tr>
                                        <tr>
                                            <td width="10%;" id="ycd"></td>
                                        </tr>
                                    </table>

                                    <form id="formID4">
                                        <input name="compId" id="compId" style="display:none;">
                                        <textarea id="message" name="message" class="maskArea" placeholder="必要的文字描述"
                                                  style="width:100%;height:150px;"></textarea>
                                    </form>
                                </div>
                            </div>
                            <!--/section:plugins/printThis ends here  -->
                            <div class="col-xs-12">
                                <button class="btn btn-info pull-right" type="button" onclick="pr2()"
                                        style="margin-right:20px;">
                                    <i class="ace-icon fa fa-check bigger-110"></i>
                                    打印
                                </button>
                                <button class="btn btn-info pull-right" type="button" id="operationOk"
                                        onclick="operationOk()" style="margin-right:20px;display: none;">
                                    <i class="ace-icon fa fa-check bigger-110"></i>
                                    确认
                                </button>
                                <button class="btn btn-info pull-right" type="button" id="ownershipOk"
                                        onclick="ownershipOk()" style="margin-right:20px;display: none;">
                                    <i class="ace-icon fa fa-check bigger-110"></i>
                                    审核通过
                                </button>
                                <button class="btn btn-info pull-right" type="button" id="regulatorOk"
                                        onclick="regulatorOk()" style="margin-right:20px;display: none;">
                                    <i class="ace-icon fa fa-check bigger-110"></i>
                                    审核通过
                                </button>
                                <button class="btn btn-info pull-right" type="button" id="constructionSectorOk"
                                        onclick="constructionSectorOk()" style="margin-right:20px;display: none;">
                                    <i class="ace-icon fa fa-check bigger-110"></i>
                                    审核通过
                                </button>
                                <button class="btn btn-info pull-right" type="button" id="projectManagerOk"
                                        onclick="projectManagerOk()" style="margin-right:20px;display: none;">
                                    <i class="ace-icon fa fa-check bigger-110"></i>
                                    审核通过
                                </button>
                                <script type="text/javascript">
                                    if (role == "管线权属") {
                                        $("#ownershipOk").css('display', 'block');
                                    }
                                    if (role == "监管人员") {
                                        $("#regulatorOk").css('display', 'block');
                                    }
                                    if (role == "施工单位") {
                                        $("#constructionSectorOk").css('display', 'block');
                                    }
                                    if (role == "项目经理") {
                                        $("#projectManagerOk").css('display', 'block');
                                    }
                                    if (role == "操作人员" && flag == "1") {
                                        $("#operationOk").css('display', 'block');
                                    }
                                </script>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="modal inmodal" id="myModal1" tabindex="-1" role="dialog" aria-hidden="true" style="margin:10%;">
                <div class="modal-dialog">
                    <div class="modal-content animated fadeIn">
                        <div class="modal-head" style="text-align:center">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="margin:5px 7px 0 0;"><i class="ace-icon fa fa-times"></i></button>
                            <h3 class="modal-title">总平面上传</h3>
                        </div>
                        <div class="modal-body">
                            <div class="row">
                                <form id="formID1" action="" method="post" enctype="multipart/form-data" class="col-xs-12">
                                    <div class="input-group col-xs-12" style="margin-top:10px;">
                                        <label class="col-xs-2">文件浏览</label>
                                        <div class="clearfix col-xs-8" style="padding:0;">
                                            <div class="col-xs-12 col-sm-12 no-padding-left no-padding-right"><input type="file" name="fileField1" id="fileField1"></div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <input type="button" class="btn btn-primary pull-right" value="上传" onclick="field1Upload()" />
                        </div>
                    </div>
                </div>
            </div>

            <div class="modal inmodal" id="myModal2" tabindex="-1" role="dialog" aria-hidden="true" style="margin:10%;">
                <div class="modal-dialog">
                    <div class="modal-content animated fadeIn">
                        <div class="modal-head" style="text-align:center">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="margin:5px 7px 0 0;"><i class="ace-icon fa fa-times"></i></button>
                            <h3 class="modal-title">引入端图片上传</h3>
                        </div>
                        <div class="modal-body">
                            <div class="row">
                                <form id="formID2" action="" method="post" enctype="multipart/form-data" class="col-xs-12">
                                    <div class="input-group col-xs-12" style="margin-top:10px;">
                                        <label class="col-xs-2">文件浏览</label>
                                        <div class="clearfix col-xs-8" style="padding:0;">
                                            <div class="col-xs-12 col-sm-12 no-padding-left no-padding-right"><input type="file" name="fileField2" id="fileField2"></div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <input type="button" class="btn btn-primary pull-right" value="上传" onclick="field2Upload()" />
                        </div>
                    </div>
                </div>
            </div>

            <div class="modal inmodal" id="myModal3" tabindex="-1" role="dialog" aria-hidden="true" style="margin:10%;">
                <div class="modal-dialog">
                    <div class="modal-content animated fadeIn">
                        <div class="modal-head" style="text-align:center">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="margin:5px 7px 0 0;"><i class="ace-icon fa fa-times"></i></button>
                            <h3 class="modal-title">引出端图片上传</h3>
                        </div>
                        <div class="modal-body">
                            <div class="row">
                                <form id="formID3" action="" method="post" enctype="multipart/form-data" class="col-xs-12">
                                    <div class="input-group col-xs-12" style="margin-top:10px;">
                                        <label class="col-xs-2">文件浏览</label>
                                        <div class="clearfix col-xs-8" style="padding:0;">
                                            <div class="col-xs-12 col-sm-12 no-padding-left no-padding-right"><input type="file" name="fileField3" id="fileField3"></div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <input type="button" class="btn btn-primary pull-right" value="上传" onclick="field3Upload()" />
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
<script type="text/javascript">
    if ('ontouchstart' in document.documentElement) document.write("<script src='${contextPath}/resources/assets/js/jquery.mobile.custom.js'>" + "<" + "/script>");
</script>
<script src="${contextPath}/resources/assets/js/bootstrap.js"></script>
<script src="${contextPath}/resources/js/jquery.form.js"></script>
<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

<!--[if lte IE 8]>
<script src="${contextPath}/resources/assets/js/html5shiv.js"></script>
<script src="${contextPath}/resources/assets/js/respond.js"></script>
<![endif]-->
<script src="${contextPath}/resources/assets/js/ace/elements.scroller.js"></script>
<script src="${contextPath}/resources/assets/js/ace/elements.colorpicker.js"></script>
<script src="${contextPath}/resources/assets/js/ace/elements.fileinput.js"></script>
<script src="${contextPath}/resources/assets/js/ace/elements.typeahead.js"></script>
<script src="${contextPath}/resources/assets/js/ace/elements.wysiwyg.js"></script>
<script src="${contextPath}/resources/assets/js/ace/elements.spinner.js"></script>
<script src="${contextPath}/resources/assets/js/ace/elements.treeview.js"></script>
<script src="${contextPath}/resources/assets/js/ace/elements.wizard.js"></script>
<script src="${contextPath}/resources/assets/js/ace/elements.aside.js"></script>
<script src="${contextPath}/resources/assets/js/ace/ace.js"></script>
<script src="${contextPath}/resources/assets/js/ace/ace.ajax-content.js"></script>
<script src="${contextPath}/resources/assets/js/ace/ace.touch-drag.js"></script>
<script src="${contextPath}/resources/assets/js/ace/ace.sidebar.js"></script>
<script src="${contextPath}/resources/assets/js/ace/ace.sidebar-scroll-1.js"></script>
<script src="${contextPath}/resources/assets/js/ace/ace.submenu-hover.js"></script>
<script src="${contextPath}/resources/assets/js/ace/ace.widget-box.js"></script>
<script src="${contextPath}/resources/assets/js/ace/ace.settings.js"></script>
<script src="${contextPath}/resources/assets/js/ace/ace.settings-rtl.js"></script>
<script src="${contextPath}/resources/assets/js/ace/ace.settings-skin.js"></script>
<script src="${contextPath}/resources/assets/js/ace/ace.widget-on-reload.js"></script>
<script src="${contextPath}/resources/assets/js/ace/ace.searchbox-autocomplete.js"></script>
<script src="${contextPath}/resources/assets/js/ace/ace.hover-dropdown.js"></script>

<!-- WebGL threejs -->
<script src="${contextPath}/resources/js/ThreeJS/Detector.min.js"></script>
<script src="${contextPath}/resources/js/ThreeJS/three.min.js"></script>
<script src="${contextPath}/resources/js/ThreeJS/TrackballControls.min.js"></script>
<script src="${contextPath}/resources/js/ThreeJS/AxisSystem.min.js"></script>
<script src="${contextPath}/resources/js/ThreeJS/viewer3d.js"></script>

<script type="text/javascript">

    function field1Upload(){
        var fileField1 = $('#fileField1').val();
        if(fileField1==""){
            alert("请完成必要的操作后提交！");
        }
        else{
            document.getElementById("formID1").action="fayzfield1Upload?compId="+compId;
            $("#formID1").ajaxSubmit({
                success: function(data) {
                    window.location.reload();
                }
        });
            return false;
        }
    }

    function field2Upload(){
        var fileField2 = $('#fileField2').val();
        if(fileField2==""){
            alert("请完成必要的操作后提交！");
        }
        else{
            document.getElementById("formID2").action="fayzfield2Upload?compId="+compId;
            $("#formID2").ajaxSubmit({
                success: function(data) {
                    window.location.reload();
                }
            });
            return false;
        }
    }

    function field3Upload(){
        var fileField3 = $('#fileField3').val();
        if(fileField3==""){
            alert("请完成必要的操作后提交！");
        }
        else{
            document.getElementById("formID3").action="fayzfield3Upload?compId="+compId;
            $("#formID3").ajaxSubmit({
                success: function(data) {
                    window.location.reload();
                }
            });
            return false;
        }
    }

    function fayzdownload(path){
        window.open('fayzdownload?file='+encodeURIComponent(path));
    }

    VIEWER.container = document.getElementById('webglcanvas');

    VIEWER.width = 600;
    VIEWER.height = 400;
    VIEWER.destroy = false;

    VIEWER.renderer_init(VIEWER.container);
    $(window).resize(function () {
        VIEWER.renderer_setSize(VIEWER.width, VIEWER.height);
        VIEWER.renderer_render();
    });
    VIEWER.renderer_render();
    VIEWER.animate();
    VIEWER.LoadModel("${contextPath}/resources/UploadFiles/ThreeJSExporter/dian${pipeId}.js");
</script>

</body>
</html>
